import { RouteConfig } from "vue-router"

const routes: Array<RouteConfig> = [
  {
    path: "/customers/:id",
    name: "CustomerDetail",
    props: true,
    component: () => import("../views/customer").then(customer => customer.Detail),
    meta: { requiresAuth: true },
  },
  {
    path: "/customers/:id/avatar",
    name: "CustomerAvatarCropper",
    props: (route) => ({
      id: route.params.id,
      avatar: route.query.avatar,
    }),
    component: () => import("../views/customer").then(customer => customer.AvatarCropper),
    meta: { requiresAuth: true },
  },
  {
    path: "/customers/:id/nickname/:nickname",
    name: "CustomerSetNickname",
    props: true,
    component: () => import("../views/customer").then(customer => customer.SetNickname),
    meta: { requiresAuth: true },
  },
]

export default routes
